Skip to content

UofT-DSI | sql - Assignment 1#1

Merged
Chun-YuanChen merged 1 commit intomainfrom
assignment-one
Aug 16, 2025
Merged

UofT-DSI | sql - Assignment 1#1
Chun-YuanChen merged 1 commit intomainfrom
assignment-one

Conversation

@Chun-YuanChen
Copy link
Owner

What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)

An entity-relationship diagram was created with a .pdf file, followed by SQL queries in a .sql file with my personal comments. The queries include selecting specific columns or rows, deriving new columns, recategorizing values, using wildcards (e.g., %), and filtering based on defined conditions like total amount spent.

What did you learn from the changes you have made?

I learned how to write and run basic SQL queries in SQLite, get a better familiarity of how to use Git commands to push updates to GitHub again, and have a good grasp of applying entity-relationship diagrams to visualize the structure of a database with multiple tables.

Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?

I considered using both VS Code and DB Browser to run SQL queries, as it would be a good window to get familiar with each tool and compare results. However, I realized it is more effective to focus on one tool at a time, especially at first, and switch to the next when ready.

Were there any challenges? If so, what issue(s) did you face? How did you overcome it?

One challenge was getting familiar with the structure of SQL queries. Unlike languages like R or Python, I felt like SQL has a more rigid, predefined order for its keywords, which I think will take more time to get used to. Working on small additional projects myself could be a helpful way to reinforce my learning in a short period of time.

How were these changes tested?

Once I completed a query, I often tried alternative methods, if available, to see if I could achieve the same results. I also reviewed the raw dataset to check for consistency between the output and the original data, which I think is important.

A reference to a related issue in your repository (if applicable)

None.

Checklist

  • I can confirm that my changes are working as intended


SELECT *, quantity * cost_to_customer_per_qty AS price
FROM customer_purchases
WHERE vendor_id BETWEEN 8 AND 10; /* Note: Just curious myself, unsure if BETWEEN can be set as inclusive or exclusive like other languages. */

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BETWEEN is always inclusive (both ends)

Copy link

@monzchan monzchan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done

@Chun-YuanChen Chun-YuanChen merged commit 71db80a into main Aug 16, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants